# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=gitem
pkgver=104.d40a1c9
pkgrel=8
groups=('blackarch' 'blackarch-recon')
pkgdesc='A Github organization reconnaissance tool.'
arch=('any')
url='https://github.com/mschwager/gitem'
depends=('python' 'python-requests')
makedepends=('git' 'python-setuptools')
license=('GPL3')
source=("git+https://github.com/mschwager/$pkgname.git"
        'requirements.txt.patch')
sha512sums=('SKIP'
            '858e7040f448c7cd0c11adfafde5f34748d48e4130dc8610a373753e29eb8d12d56f571b0ddd747befddb26e6f18857b5ab776885bc116b06eb35f27515366ea')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

prepare() {
  patch -p1 < requirements.txt.patch
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 -t "$pkgdir/usr/share/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/$pkgname/LICENSE"
}

